//#include <iostream>
//using namespace std;
//int main()
//{
//
//	return 0;
//}
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int  x[1010] = { 0 };
int y[1010] = { 0 };

struct fanwei
{
	double l;
	double r;
}qu[1010];
int cmp(const fanwei &qu1, const fanwei &qu2)
{
	return qu1.l < qu2.l;
}

int main()
{
	int n, d;
	cin >> n >> d;
	for (int i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		if (y[i] > d) 
		{
			cout << -1;
			return 0;
		}
		
	}
	for (int i = 0; i < n; i++)
	{
		qu[i].l = x[i] - sqrt(d * d - y[i] * y[i]);
		qu[i].r = x[i] + sqrt(d * d - y[i] * y[i]);
	}
	sort(qu, qu + n, cmp);
	int num = 1;
	double right = qu[0].r;
	for (int i = 1; i < n; i++)
	{
		if (qu[i].r < right)
		{
			right = qu[i].r;
		}
		if (qu[i].l > right)
		{
			num++;
			right = qu[i].r;
		}
	}
	cout << num;
	return 0;
}